clear all
clc
close all

alpha_f = 40*pi/180;
beta_f = 0*pi/180;

alpha_s = (0:5:360) * pi/180;
beta_s = (0:5:360) * pi/180;

S = 1;

beta = H(alpha_f,beta_f);
F = nan(length(alpha_s),length(beta_s));

for i = 1:length(alpha_s)
    for j= 1:length(beta_s)
   
      y = H(alpha_s(i),beta_s(j)) * S;  
      U = beta' * y;
      F(i,j) = ( abs(U/S) )^2;
        
    end
end

figure;
% surf(alpha_s,beta_s,F);

[alpha_sm,beta_sm] = meshgrid(alpha_s,beta_s);
[Fx,Fy,Fz] = sph2cart(alpha_sm,beta_sm, F);

surf(Fx,Fy,Fz);